<%-- 
    Document   : search
    Created on : Aug 2, 2013, 9:18:56 PM
    Author     : Thien Nguyen
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tìm kiếm</title>
    </head>
    <body>
        <c:if test="${empty username}">
            <jsp:include page="header.jsp"/>
        </c:if>
        <c:if test="${not empty username}">
            <jsp:include page="header1.jsp"/>
        </c:if>
        <div class="m-left">

            <div class="left-cm">
                <div class="hotman">
                    <div class="b1">
                    </div>
                    <div class="b2">
                    </div>
                    <div class="b3">
                    </div>
                    <div class="b4">
                    </div>
                    <div class="pad" style="padding-bottom: 10px">
                        <div class="h-main">
                            <div class="pagetk">
                                <form name="music_search" method="get" action="ControllerServlet">
                                    <div class="pg-tk">
                                        <div class="pg-cn">
                                            <div class="tkiem">
                                                <div class="tk-ttop">
                                                </div>
                                                <div class="tk-tc">
                                                    <input class="inputd" type="text" name="searchValue" size="40" value="">
                                                </div>
                                                <div class="tk-te">
                                                </div>
                                                <div class="tk-tbt">
                                                    <input type="submit" value="" name="btnAction" />
                                                </div>
                                            </div>
                                            <div class="timtheo">
                                                <span style="float: left;">Tìm theo:</span>
                                                <p class="vmk"> <input class="radio" id="m" name="mode" value="" type="radio"><label for="m">Tên bài hát/Ca sĩ</label> <input class="radio" id="martist" name="mode" value="artist" type="radio"><label for="martist">Ca sĩ</label> <input class="radio" id="mcomposer" name="mode" value="composer" type="radio"><label for="mcomposer">Sáng tác</label> <input class="radio" id="malbum" name="mode" value="album" type="radio"><label for="malbum">Tên Album</label> <input class="radio" id="mlyric" name="mode" value="lyric" type="radio"><label for="mlyric">Lời bài hát</label></p>
                                            </div>
                                            <div class="timtheo">
                                                <span style="float: left;">Chuyên mục tìm:</span>
                                                <p class="vmk"> <input class="radio" id="c" name="cat" value="*" type="radio"><label for="c">Tất cả</label> <input class="radio" id="cvideo" name="cat" value="video" type="radio"><label for="cvideo">Video</label> <input class="radio" id="cmusic" name="cat" value="music" type="radio"><label for="cmusic">Nhạc</label></p>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="page-dsms">
                                <div class="pg-top" style="margin-bottom: 10px;">
                                    <img src="images/tnghe.gif">
                                    <span> ${mode}: ${searchValue}</span>
                                </div>
                                <div class="bod">
                                    <div class="vt11">
                                    </div>
                                    <div class="vt21">
                                    </div>
                                    <div class="vt31">
                                    </div>
                                    <div class="vt41">
                                    </div>
                                    <c:if test="${not empty LIST}">
                                        <c:set var="count" value="1" scope="page" />
                                        <table class="tbtable" cellpadding="0" width="100%">
                                            <tbody>
                                                <tr>
                                                    <th>STT</th>
                                                    <th align="left">Tên bài hát / Ca sĩ</th>
                                                    <th width="70" nowrap="nowrap">Chất lượng</th>
                                                    <th width="65" nowrap="nowrap">Ghi chú</th>
                                                    <th align="left" width="170" nowrap="nowrap">Chuyên mục / Sáng tác</th>
                                                    <th width="50" nowrap="nowrap">Downloads</th>
                                                </tr>
                                                <c:forEach var="item" items="${LIST}" varStatus="counter" >
                                                    <c:if test="${not empty item.l1}">
                                                        <tr title="">
                                                            <td align="center">
                                                                <p>${count}</p>
                                                                <c:set var="count" value="${count + 1}" scope="page" />
                                                            </td>
                                                            <td>
                                                                <div>
                                                                    <div class="tenbh">
                                                                        <p><a href="ControllerServlet?btnAction=Listen&id=${item.songID}&type=<c:if test="${item.isSong eq true}">music</c:if><c:if test="${item.isSong eq false}">video</c:if>" class="musictitle" target="_top">${item.name}</a></p>
                                                                        <p>${item.artists.artistName}</p>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <span style="color: darkgreen">128kbps</span>
                                                            </td>
                                                            <td align="center" title="">
                                                                <div style="height: 28px; width: 62px; font-size: 10px; overflow: hidden;"></div>
                                                            </td>
                                                            <td style="font-size: 10px;">
                                                                <p><a href="">${item.country.countryName}</a> -&gt <a href=""></a>${item.genres.genreName} </p>
                                                                <p>Album: ${item.albums.albumName} (${item.publishYear})</p>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <p>${item.downloaded}</p></td>
                                                        </tr>
                                                    </c:if>
                                                    <c:if test="${not empty item.l2}">
                                                        <tr title="">
                                                            <td align="center">
                                                                <p>${count}</p>
                                                                <c:set var="count" value="${count + 1}" scope="page" />
                                                            </td>
                                                            <td>
                                                                <div>
                                                                    <div class="tenbh">
                                                                        <p><a href="ControllerServlet?btnAction=Listen&id=${item.songID}&type=<c:if test="${item.isSong eq true}">music</c:if><c:if test="${item.isSong eq false}">video</c:if>" class="musictitle" target="_top">${item.name}</a></p>
                                                                        <p>${item.artists.artistName}</p>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <span style="color: darkgreen">320kbps</span>
                                                            </td>
                                                            <td align="center" title="">
                                                                <div style="height: 28px; width: 62px; font-size: 10px; overflow: hidden;"></div>
                                                            </td>
                                                            <td style="font-size: 10px;">
                                                                <p><a href="">${item.country.countryName}</a> -&gt <a href=""></a>${item.genres.genreName} </p>
                                                                <p>Album: ${item.albums.albumName} (${item.publishYear})</p>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <p>${item.downloaded}</p></td>
                                                        </tr>
                                                    </c:if>
                                                    <c:if test="${not empty item.l3}">
                                                        <tr title="">
                                                            <td align="center">
                                                                <p>${count}</p>
                                                                <c:set var="count" value="${count + 1}" scope="page" />
                                                            </td>
                                                            <td>
                                                                <div>
                                                                    <div class="tenbh">
                                                                        <p><a href="ControllerServlet?btnAction=Listen&id=${item.songID}&type=<c:if test="${item.isSong eq true}">music</c:if><c:if test="${item.isSong eq false}">video</c:if>" class="musictitle" target="_top">${item.name}</a></p>
                                                                        <p>${item.artists.artistName}</p>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <span style="color: darkgreen">500kbps</span>
                                                            </td>
                                                            <td align="center" title="">
                                                                <div style="height: 28px; width: 62px; font-size: 10px; overflow: hidden;"></div>
                                                            </td>
                                                            <td style="font-size: 10px;">
                                                                <p><a href="">${item.country.countryName}</a> -&gt <a href=""></a>${item.genres.genreName} </p>
                                                                <p>Album: ${item.albums.albumName} (${item.publishYear})</p>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <p>${item.downloaded}</p></td>
                                                        </tr>
                                                    </c:if>
                                                    <c:if test="${not empty item.l4}">
                                                        <tr title="">
                                                            <td align="center">
                                                                <p>${count}</p>
                                                                <c:set var="count" value="${count + 1}" scope="page" />
                                                            </td>
                                                            <td>
                                                                <div>
                                                                    <div class="tenbh">
                                                                        <p><a href="ControllerServlet?btnAction=Listen&id=${item.songID}&type=<c:if test="${item.isSong eq true}">music</c:if><c:if test="${item.isSong eq false}">video</c:if>" class="musictitle" target="_top">${item.name}</a></p>
                                                                        <p>${item.artists.artistName}</p>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <span style="color: red">Lossless</span>
                                                            </td>
                                                            <td align="center" title="">
                                                                <div style="height: 28px; width: 62px; font-size: 10px; overflow: hidden;"></div>
                                                            </td>
                                                            <td style="font-size: 10px;">
                                                                <p><a href="">${item.country.countryName}</a> -&gt <a href=""></a>${item.genres.genreName} </p>
                                                                <p>Album: ${item.albums.albumName} (${item.publishYear})</p>
                                                            </td>
                                                            <td nowrap="nowrap" align="center">
                                                                <p>${item.downloaded}</p></td>
                                                        </tr>
                                                    </c:if>
                                                </c:forEach>
                                            </tbody>
                                        </table>
                                    </c:if>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <jsp:include page="mainRight.jsp"/>
        <jsp:include page="footer.jsp"/>
    </body>
</html>
